#ifndef __COMMON_H__
#define __COMMON_H__

enum {
    REG_FICATION   = 0x00,  // 注册
    NOTI_FICATION  = 0x11,  // 通知
    SUBI_FICATION  = 0x02,  // 订阅
    REP_FICATION   = 0x03,  // 请求
    BROAD_FICATION = 0x04,  // 广播
}svcID_typ;

enum {
    CLIENT_ID_0   = 0x00,  // 客户端0
    CLIENT_ID_1   = 0x01,  // 客户端1
    CLIENT_ID_2   = 0x02,  // 客户端2
}clientID_typ;

enum {
    REQUEST = 0x00,
    REQUEST_NO_RETURN = 0x01,
    NOTIFICATION = 0x02,
    RESPONSE = 0x80,
    ERROR = 0x81,
} MessageType;

enum {
    RET_OK = 0x00,
    RET_NG = 0x01,
} ret_typ;  

typedef struct {
    unsigned short svcID; //Service ID; 标识出一个服务
    unsigned short localID; //Local ID; 客户端ID,区分不同客户端
    unsigned short targetID;  //target ID 目标客户端的id
    unsigned char  type;  // | Message Type [.... xxxx]  报文类型,目前共5种
    unsigned char  retCode;//返回码Return Code (0x00 Ok) ;
    unsigned int   length;//Length (此字节之后的长度)
    char payload[2048];//数据段
} transmit_message;

#endif
